{%include file="index.header.tpl.php"%}
{%include file="index.left.tpl.php"%}
  <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <section class="col-lg-12 connectedSortable">
         <div class="box box-default box-solid">
             <form name="myform" action="" method="post" role="form" enctype="multipart/form-data">
                <div class="box-header with-border">
                    <span class="fa fa-pencil" style="float:left; font-size:18px; padding-top:3px; color:#3c8dbc;" ></span>
                    <p class="box-title">{%if $type eq 1%}继续教育{%else%}其他资料{%/if%}添加</p>
                </div>
                <div class="box-body">
					<input type="hidden" name="keep_type" value="{%$type%}">
					{%if $type eq 1%}
				   <div class="form-group">
						  <label for="inputPassword3" class="col-md-3 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
							   项目名称：
						  </label>
						  <div class="input-group col-md-6 col-sm-12 col-xs-12">
							   <input type="text" name="keep_name" class="form-control" required="required">
						  </div> 
				    </div>
					
					<div class="form-group">
						<label for="inputPassword3" class="col-md-3 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
							教师姓名：
						</label>
						<div class="input-group col-md-6 col-sm-12 col-xs-12">
							<select class="form-control" name="staff_id">
								{%foreach from=$teachers key=key item=value%}
								<option value="{%$value.staff_id%}"> {%$value.staff_name%}</option>
								{%/foreach%}
							</select>
						</div>
					</div>
					<div class="form-group">
						<label for="inputPassword3" class="col-md-3 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
							{%if $type eq 1%}培训日期{%else%}提交日期{%/if%}：
						</label>
						<div class="input-group col-md-6 col-sm-12 col-xs-12">
							<input type="text" class="form-control" name="keep_time"  id="datepicker" />
							<div class="input-group-addon">
								<i class="fa fa-calendar"></i>
							</div>
						</div>
					</div>
					{%/if%}
					{%if $type eq 1%}
					<div class="form-group">
						<label for="inputPassword3" class="col-md-3 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
							培训机构：
						</label>
						<div class="input-group col-md-6 col-sm-12 col-xs-12">
							<input type="text" name="keep_unit" class="form-control" required="required">
						</div>
					</div>
					<div class="form-group">
						  <label for="inputPassword3" class="col-md-3 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
							   学时：
						  </label>
						  <div class="input-group col-md-6 col-sm-12 col-xs-12">
							   <input type="text" name="keep_hour" class="form-control" required="required">
						  </div> 
				    </div>

					<div class="form-group">
						<label for="inputPassword3" class="col-md-3 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
							学分：
						</label>
						<div class="input-group col-md-6 col-sm-12 col-xs-12">
							<input type="text" name="keep_min" class="form-control" required="required">
						</div>
					</div>

					<div class="form-group">
						<label for="inputPassword3" class="col-md-3 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
							实际学分：
						</label>
						<div class="input-group col-md-6 col-sm-12 col-xs-12">
							<input type="text" name="keep_score" class="form-control" required="required">
						</div>
					</div>
					<div class="form-group">
						<label for="inputPassword3" class="col-md-3 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
							备注：
						</label>
						<div class="input-group col-md-6 col-sm-12 col-xs-12">
							<input type="text" name="keep_remark" class="form-control"">
						</div>
					</div>
					{%else%}
					
					<div class="form-group">
						  <label for="inputPassword3" class="col-md-1 control-label " style="padding-right:0; padding-left:0; font-weight:500;">
							   项目名称：
						  </label>
						  <div class="input-group col-md-6 col-sm-12 col-xs-12">
							   <input type="text" name="keep_name" class="form-control" required="required">
						  </div> 
				    </div>
					<div class="form-group">
						 <label class="col-md-1 control-label" style="padding-right:0; padding-left:0; font-weight:500;">
							   文章内容：
						  </label>
                          <div class="input-group col-md-10 col-sm-12 col-xs-12">
						     <textarea id="category_content" name="keep_content" rows="12" style="width: 100%"></textarea>
						 </div>
					</div>


					<div class="form-group">
						  <label class="col-md-1 control-label" style="padding-right:0; padding-left:0; font-weight:500;">
							   附件：
						  </label>
						  <div class="input-group  col-sm-11 col-xs-12">
                              <input id="manage_file" name="keep_file" type="file"/>
						  </div> 
				    </div>
					{%/if%}
				</div><!--box-body --> 
                <div class="box-footer text-center">
                     <button class="btn btn-primary" type="submit">保 存 信 息</button>
                 </div>
             </form>
           </div><!--box box-default box-solid-->
        </section>   
           
        </div><!--row-->
    </section>
 </div>
<!--主要内容结束-->   
{%include file="index.footer.tpl.php"%}
  <script>
  $(function() {
    $( "#datepicker" ).datepicker({
      showOtherMonths: true,
      selectOtherMonths: true,
	  changeMonth: true,
      changeYear: true,
	  yearRange:"1930:2010"
    });
	$( "#datepicker1" ).datepicker({
      showOtherMonths: true,
      selectOtherMonths: true,
	  changeMonth: true,
      changeYear: true
    });
	$( "#datepicker2" ).datepicker({
      showOtherMonths: true,
      selectOtherMonths: true,
	  changeMonth: true,
      changeYear: true
    });
	$( "#datepicker3" ).datepicker({
      showOtherMonths: true,
      selectOtherMonths: true,
	  changeMonth: true,
      changeYear: true
    });
  });
  //上传图片
  $(function(){
        var imgurl=[];
        function createfile(){
        $('#updiv').append("<input type='file'  name='photos' class='upfile'>");
        }
        function showimg(url){
            var img='<img src="'+url+'"/>';
            $('#imglist').append(img);
        }
        function addfile(){
            showimg($(this).val());
            $(this).hide();
            createfile();
            $('.upfile').bind('change',addfile);
        }
        $('.upfile').bind('change',addfile);
    })
</script>
{%if $type eq 5%}
<script>
	$(function (){
		$('#keep_owner').blur(function(){
			var name = $('#keep_owner').val();
			$.post('index.php?a=keep.checks',{name:name},function ($data) {
				if($data == 0){alert('未找到相应学生');}
			});
		})
	})
</script>
{%/if%}
<script type="text/javascript" src="static/xhe/xheditor-1.2.2.min.js"></script>
<script type="text/javascript" src="static/xhe/xheditor_lang/zh-cn.js"></script>
<script type="text/javascript">
$(pageInit);
function pageInit()
{
	$.extend(XHEDITOR.settings,{shortcuts:{'ctrl+enter':submitForm}});//修改默认设置
	$('#category_content').xheditor({modalWidth:700,modalHeight:500,upBtnText:'浏览',upLinkUrl:"!ckfinder/upload.html",upImgUrl:"!ckfinder/upload.html?type=Images",upFlashUrl:"!ckfinder/upload.html?type=Flash",upMediaUrl:"!ckfinder/upload.html"});
}
function submitForm(){$('#myform').submit();}
</script>